// 0536907327   加纳
// pin 2023

// 0536832506   加纳
// pin 2023

// 0535982669
// 2023
// const Constant = require("./constant.js");

// storage keys
const STORAGE_NAME = "WALLET_NAME";

// ui keys
const UI_WALLET_MOBILE = "WALLET_NUMBER";
const UI_WALLET_PIN = "WALLET_PIN";
const UI_WALLET_AMOUNT = "WALLET_AMOUNT";
const UI_SDK_VERSION = "V87: ";

// momo-加纳 keys
const WALLET_MTN_GHS_NAME = "MOMO_GHS";
const TARGET_MTN_GHS_AMUONT = "1";
const TARGET_MTN_GHS_MOBILE = "0532807598";
const TARGET_MTN_GHS_REFERENCE = "harry";

// momo-科特 keys
const WALLET_MTN_FCFA_NAME = "MOMO_FCFA";
const TARGET_MTN_FCFA_AMOUNT = "1";
const TARGET_MTN_FCFA_MOBILE = "0586608914";
const TARGET_MTN_FCFA_REFERENCE = "TEST T1";

// momo-喀唛隆 keys
const WALLET_MTN_XAF_NAME = "MOMO_XAF";
const TARGET_MTN_XAF_AMOUNT = "1";
const TARGET_MTN_XAF_MOBILE = "683936882";
const TARGET_MTN_XAF_REFERENCE = "TEST T1";

// momo-乌干达 keys
const WALLET_MTN_UGX_NAME = "MOMO_UGX";
const TARGET_MTN_UGX_AMOUNT = "1";
const TARGET_MTN_UGX_MOBILE = "672660328";
const TARGET_MTN_UGX_REFERENCE = "TEST T1";
const TARGET_MTN_UGX_RECEIVER = "TEST T1";

// wave-科特 keys
const WALLET_WAVE_UGX_NAME = "WAVE_FCFA";
const WAVE_FCFA_MOBILE = "0768001515";
const TARGET_WAVE_FCFA_MOBILE = "0710002459";
const TARGET_WAVE_FCFA_NAME = "TEST T1";
const TARGET_WAVE_FCFA_AMOUNT = "5";
const TARGET_WAVE_FCFA_REFERENCE = "TEST T1";

// orange-科特/喀唛隆 keys
const WALLET_ORANGE_FCFA_NAME = "ORANGE_FCFA";
const ORANGE_FCFA_MOBILE = "0768001515";
const TARGET_ORANGE_FCFA_MOBILE = "690518436";//"0710002459";
const TARGET_ORANGE_FCFA_NAME = "TEST T1";
const TARGET_ORANGE_FCFA_AMOUNT = "5";
const TARGET_ORANGE_FCFA_REFERENCE = "TEST T1";

// vodafone-加纳 keys
const WALLET_VODAFONE_GHS_NAME = "VODAFONE_GHS";
const WALLET_VODAFONE_GHS_MNO = "vodafone";
const TARGET_VODAFONE_GHS_AMUONT = "1";
const TARGET_VODAFONE_GHS_MOBILE = "0201713503";
const TARGET_VODAFONE_GHS_REFERENCE = "test";

// m-pesa-肯尼亚 keys
const WALLET_MPESA_KES_NAME = "MPESA_KES";
const MPESA_KES_MOBILE = "0768001515";
const TARGET_MPESA_KES_MOBILE = "690518436";//"0710002459";
const TARGET_MPESA_KES_NAME = "TEST T1";
const TARGET_MPESA_KES_AMOUNT = "5";
const TARGET_MPESA_KES_REFERENCE = "TEST T1";

// airtel-赞比亚 keys
const WALLET_AIRTEL_ZMW_NAME = "AIRTEL_ZMW";
const TARGET_AIRTEL_ZMW_AMUONT = "1";
const TARGET_AIRTEL_ZMW_MOBILE = "0201713503";
const TARGET_AIRTEL_ZMW_REFERENCE = "test";

// airtel-乌干达 keys
const WALLET_AIRTEL_UGX_NAME = "AIRTEL_UGX";
const TARGET_AIRTEL_UGX_AMUONT = "1";
const TARGET_AIRTEL_UGX_MOBILE = "0201713503";
const TARGET_AIRTEL_UGX_REFERENCE = "test";

var mMtn = "";
var mPin = "";
var mAmount = "";

const getMtn = () => {
    return mMtn;
}

const setMtn = (newValue) => {
    mMtn = newValue || "";

    let storage = storages.create(STORAGE_NAME);
    storage.put(UI_WALLET_MOBILE, newValue + "");
}

const getPin = () => {
    return mPin.trim();
}

const setPin = (newValue) => {
    mPin = newValue || "";

    let storage = storages.create(STORAGE_NAME);
    storage.put(UI_WALLET_PIN, newValue + "");
}

const getAmount = () => {
    return mAmount;
}

const setAmount = (newValue) => {
    mAmount = newValue || "";

    let storage = storages.create(STORAGE_NAME);
    storage.put(UI_WALLET_AMOUNT, newValue + "");
}

const initMtnAndPin = () => {
    let storage = storages.create(STORAGE_NAME);
    let mtn = storage.get(UI_WALLET_MOBILE) || "";
    let pin = storage.get(UI_WALLET_PIN) || "";
    setMtn(mtn);
    setPin(pin);
}

const isNeedPinInput = () => {
    let gPin = getPin();
    if (!gPin) {
        return "visible";
    }
    if (gPin.length !== 4) {
        return "visible";
    }
    return "gone";
}

module.exports = {
    MTN: "testMTN",
    // MTN: "0535982669",
    // MTN: "0536832506",
    // MTN: "0536907327",
    // MTN: "0536893609",
    // MTN: "0537180369",
    // MTN: "0537209807",

    // MTN:"0537211241",
    // MTN:"0537150226",
    // MTN:"0537213937",
    // MTN:"0537167258",
    // MTN:"0537144904",

    // MTN:"0537652510",
    // MTN:"0537635095",
    // MTN:"0537159166",
    // MTN:"0537726968",
    // MTN:"0537741489",
    // MTN:"0537993253",

    PIN: "2023",
    // PIN: "8899",

    // ui keys
    UI_WALLET_MOBILE: UI_WALLET_MOBILE,
    UI_WALLET_PIN: UI_WALLET_PIN,
    UI_WALLET_AMOUNT: UI_WALLET_AMOUNT,
    UI_SDK_VERSION: UI_SDK_VERSION,

    // momo-加纳 keys
    WALLET_MTN_GHS_NAME: WALLET_MTN_GHS_NAME,
    TARGET_MTN_GHS_AMUONT: TARGET_MTN_GHS_AMUONT,
    TARGET_MTN_GHS_MOBILE: TARGET_MTN_GHS_MOBILE,
    TARGET_MTN_GHS_REFERENCE: TARGET_MTN_GHS_REFERENCE,

    // momo-科特 keys
    WALLET_MTN_FCFA_NAME: WALLET_MTN_FCFA_NAME,
    TARGET_MTN_FCFA_AMOUNT: TARGET_MTN_FCFA_AMOUNT,
    TARGET_MTN_FCFA_MOBILE: TARGET_MTN_FCFA_MOBILE,
    TARGET_MTN_FCFA_REFERENCE: TARGET_MTN_FCFA_REFERENCE,

    // momo-喀唛隆 keys
    WALLET_MTN_XAF_NAME: WALLET_MTN_XAF_NAME,
    TARGET_MTN_XAF_AMOUNT: TARGET_MTN_XAF_AMOUNT,
    TARGET_MTN_XAF_MOBILE: TARGET_MTN_XAF_MOBILE,
    TARGET_MTN_XAF_REFERENCE: TARGET_MTN_XAF_REFERENCE,

    // momo-乌干达 keys
    WALLET_MTN_UGX_NAME: WALLET_MTN_UGX_NAME,
    TARGET_MTN_UGX_AMOUNT: TARGET_MTN_UGX_AMOUNT,
    TARGET_MTN_UGX_MOBILE: TARGET_MTN_UGX_MOBILE,
    TARGET_MTN_UGX_REFERENCE: TARGET_MTN_UGX_REFERENCE,
    TARGET_MTN_UGX_RECEIVER: TARGET_MTN_UGX_RECEIVER,

    // wave-科特 keys
    WALLET_WAVE_UGX_NAME: WALLET_WAVE_UGX_NAME,
    WAVE_FCFA_MOBILE: WAVE_FCFA_MOBILE,
    TARGET_WAVE_FCFA_MOBILE: TARGET_WAVE_FCFA_MOBILE,
    TARGET_WAVE_FCFA_NAME: TARGET_WAVE_FCFA_NAME,
    TARGET_WAVE_FCFA_AMOUNT: TARGET_WAVE_FCFA_AMOUNT,
    TARGET_WAVE_FCFA_REFERENCE: TARGET_WAVE_FCFA_REFERENCE,

    // orange-科特 keys
    WALLET_ORANGE_FCFA_NAME: WALLET_ORANGE_FCFA_NAME,
    ORANGE_FCFA_MOBILE: ORANGE_FCFA_MOBILE,
    TARGET_ORANGE_FCFA_MOBILE: TARGET_ORANGE_FCFA_MOBILE,
    TARGET_ORANGE_FCFA_NAME: TARGET_ORANGE_FCFA_NAME,
    TARGET_ORANGE_FCFA_AMOUNT: TARGET_ORANGE_FCFA_AMOUNT,
    TARGET_ORANGE_FCFA_REFERENCE: TARGET_ORANGE_FCFA_REFERENCE,

    // vodafone-加纳 keys
    WALLET_VODAFONE_GHS_NAME: WALLET_VODAFONE_GHS_NAME,
    WALLET_VODAFONE_GHS_MNO: WALLET_VODAFONE_GHS_MNO,
    TARGET_VODAFONE_GHS_AMUONT: TARGET_VODAFONE_GHS_AMUONT,
    TARGET_VODAFONE_GHS_MOBILE: TARGET_VODAFONE_GHS_MOBILE,
    TARGET_VODAFONE_GHS_REFERENCE: TARGET_VODAFONE_GHS_REFERENCE,

    // m-pesa-肯尼亚 keys
    WALLET_MPESA_KES_NAME: WALLET_MPESA_KES_NAME,
    MPESA_KES_MOBILE: MPESA_KES_MOBILE,
    TARGET_MPESA_KES_MOBILE: TARGET_MPESA_KES_MOBILE,
    TARGET_MPESA_KES_NAME: TARGET_MPESA_KES_NAME,
    TARGET_MPESA_KES_AMOUNT: TARGET_MPESA_KES_AMOUNT,
    TARGET_MPESA_KES_REFERENCE: TARGET_MPESA_KES_REFERENCE,

    // airtel-赞比亚 keys
    WALLET_AIRTEL_ZMW_NAME: WALLET_AIRTEL_ZMW_NAME,
    TARGET_AIRTEL_ZMW_AMUONT: TARGET_AIRTEL_ZMW_AMUONT,
    TARGET_AIRTEL_ZMW_MOBILE: TARGET_AIRTEL_ZMW_MOBILE,
    TARGET_AIRTEL_ZMW_REFERENCE: TARGET_AIRTEL_ZMW_REFERENCE,

    // airtel-乌干达 keys
    WALLET_AIRTEL_UGX_NAME: WALLET_AIRTEL_UGX_NAME,
    TARGET_AIRTEL_UGX_AMUONT: TARGET_AIRTEL_UGX_AMUONT,
    TARGET_AIRTEL_UGX_MOBILE: TARGET_AIRTEL_UGX_MOBILE,
    TARGET_AIRTEL_UGX_REFERENCE: TARGET_AIRTEL_UGX_REFERENCE,

    getMtn: getMtn,
    setMtn: setMtn,
    getPin: getPin,
    setPin: setPin,
    initMtnAndPin: initMtnAndPin,
    isNeedPinInput: isNeedPinInput,

    setAmount: setAmount,
    getAmount: getAmount
};